package cc.marcio.systems.seven.load;

import java.util.ArrayList;
import java.util.List;

public class LoadAll implements DataBaseLoad {

	private List<Class> clazz;
	
	public LoadAll() {
		this.add(ContactDomLoad.class);
		this.add(UserLoad.class);
		this.add(RoundLoad.class);
		this.add(PlanetLoad.class);
		this.add(CombatLoad.class);
		this.load();
	}
	
	public void add(Class clazz) {
		if( this.clazz == null ) {
			this.clazz = new ArrayList<Class>();
		}
		this.clazz.add(clazz);
	}
	
	public void load() {
		for( Class c : this.clazz ) {
			try {
				((DataBaseLoad)c.newInstance()).load();
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}

	public static void main(String[] args) {
		new LoadAll();
	}
}
